<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Four designs',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/12/06.jpg" alt="A temporary covered path" class="framed-centred-image" width="649" height="480"/>
<section id="dreams">
	<h2>Dream journal</h2>
	<p>
		I dreamed I was cleaning my mother&apos;s house with a couple of her other children.
		I was working on some task, but she didn&apos;t think that was useful, and told me to stop.
		She then quickly rattled off about fifteen task she&apos;d rather have me do, and left.
		I completed the one task I could actually remember from her quick list, and she returned as I was finishing up.
		So I asked her what she wanted me to do next.
		She replied that I should figure it out and just do something useful.
		I&apos;d tried that to start with though, and that wasn&apos;t good enough for her.
		Nothing&apos;s ever good enough for her, unless she dictates it, and often, not even then.
		So I left, and walked back to my place.
		The other two followed me.
		A bit later, I realised that Cyrus was still under her thumb, so I really shouldn&apos;t have let him come along.
		He and I were both going to be in trouble.
		So the three of us headed back.
	</p>
	<p>
		I think the dream symbolises that I&apos;m not planning to put up with my mother&apos;s garbage any more.
		At the same time, I need to not get the child still under her thumb involved, as it could lead to trouble for both them and I.
		Oddly though, Cyrus was the one in the dream still under her power, but in the real world, she&apos;s got the least influence on him because she disowned him.
		Instead, it&apos;s Vanessa I need to be careful not to get in trouble.
		Although, my plan is a direct confrontation wit my mother.
		I&apos;m not sure why any of her other children would be involved.
	</p>
</section>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			(Disclaimer: This is all based on past knowledge, so there are no sources for me to cite.
			I haven&apos;t had time to read this week&apos;s reading assignment yet.)
		</p>
		<p>
			A binary tree is a data structure in which each node (aside from one, which I&apos;ll cover in a bit) has a parent node and up to two child nodes.
			<strong>Nodes</strong> are the smallest complete unit of a binary tree, and are basically the same as the nodes of a linked list, more or less, but with the change that a node from a binary tree has up to two child nodes, instead of up to one.
			The parent nodes contain pointers to the child nodes, so you can get to the rest of that subtree.
			The <code>root</code> node is simply the node that has no parent.
			It acts as a base to the rest of the tree, and you usually have a pointer to this node elsewhere in your program.
			If you didn&apos;t, there&apos;d be no way to access the tree at all.
			A <strong>subtree</strong> is a part of the tree that you&apos;d have if you lopped off any of the branches; it&apos;s the branch, not the bigger part of the tree.
			Each subtree is in fact a tree in its own right, but is also a part of the tree of its parent, the tree of its parent&apos;s parent, et cetera.
			It&apos;s turtles all the way down, or at least all the way down to the root.
			<strong>Leaf</strong> nodes are the nodes currently without children.
			A leaf node can become a non-leaf node if items are added or the tree is reorganised.
			Non-leaf nodes, also commonly referred to as branches, can likewise become leaf nodes if items are removed from the tree or the tree is reorganised.
		</p>
		<p>
			Once you understand the basic structure of a binary tree, height and depth become easy to understand as well.
			The <strong>height</strong> of the tree is the maximum number of parent nodes, including the root, you&apos;d need to pass through to get to a leaf node.
			A tree is said to be balanced if all leaf nodes are equidistant from the root.
			In an unbalanced tree though, you&apos;re looking for the <strong>*maximum*</strong>.
			If one leaf node takes passing through five parents, another two, and another takes eleven, the tree&apos;s height is eleven.
			The higher the tree, the longer it can take to get to some of the nodes, so it helps to sometimes rebalance your tree by rearranging all the nodes into a form with equidistant leaf nodes.
			Trees can be completely disorganised, which makes them a complete mess where you can&apos;t find anything without traversing the entire tree.
			But why even have a tree like that, when a linked list would be equally effective at disorganisation?
			Instead, trees tend to be organised along some criteria.
			For example, if the tree is alphabetised, maybe your root contains the word &quot;salad&quot;.
			Items coming before this word alphabetically would be in one branch, while anything coming later than &quot;salad&quot; is in the other branch.
			In this case, rebalancing the tree changes where the dividing lines are.
			The goal here is basically to organise things like a binary search would.
			Each time, you want to decide whether your word is higher or lower than the word of the node you&apos;re looking at, and go to the correct of the two subtrees and try again.
		</p>
		<p>
			The reason keeping the hight low in an organised binary tree is so helpful is that it lowers the average depth of the nodes.
			<strong>Depth</strong> is the distance of a given node from the root.
			Each node has its own depth, and shallower nodes take less time to reach because you don&apos;t have to pass through as many other nodes to get there.
			When placing new items on a binary tree, you traverse the tree as you would when looking for a particular item, but you&apos;re actually looking for the spot you&apos;d go to look for this node later.
			You keep going until you find a prospective parent node without a child node in the direction you need to go, and the new node becomes a child of the prospective parent node.
			Usually, you don&apos;t rebalance your tree right away, but it helps to rebalance it every once in a while if there have been a lot of additions and/or removals.
		</p>
		<p>
			For years, I&apos;ve liked to call myself a leaf node on my family tree, seeing as I&apos;ll never have any descendants.
			A family tree&apos;s not quite like a binary tree, as each family tree node has two parent nodes and can have any number of child nodes, but the metaphor is still easy to understand by anyone that knows what a binary tree is.
		</p>
	</blockquote>
</section>
<section id="defective">
	<h2>Defective item</h2>
	<p>
		That item I&apos;ve sent back for a warrantee claim twice has started to show defects again.
		At first, they were cosmetic issues, so I tried to mostly just ignore them.
		But now, the charging port keeps kicking out the cord so it won&apos;t charge unless to sit and hold the cord in with your hand.
		I can&apos;t be productive while doing that.
		I&apos;m trying really hard not to send it in again though.
		It&apos;s kind of hard to discuss the issue without explaining what the item is, so I&apos;m just going to come right out and say it: it&apos;s my dildo.
		I&apos;ve been trying to keep my entries child friendly for the most part, but sometimes adult issues come up.
		Both other times, the electrical components developed a short, so the motor didn&apos;t work continuously.
		There was nothing I could do; the thing is sealed, so there&apos;s no way to even <strong>*see*</strong> the wires, let alone try to fix them.
		So far though, this one&apos;s electronics are still functioning, so I should be able to do <strong>*something*</strong> on my end.
		This morning, I duct taped one of my hair bands to the cord, so the hair band can bind the cord to the dildo and keep the thing charging.
		The tricky part was making sure the hair band pulled the cord directly into the charging port, and didn&apos;t instead pull at an angle and pull the cord over.
		I don&apos;t want the <strong>*cord*<strong> to develop a short as well!
		So far, this setup seems to be working, though it&apos;s stupid it&apos;s even needed in the first place.
	</p>
</section>
<section id="hair">
	<h2>Hair removal</h2>
	<p>
		I&apos;m out of that hair-removal remedy that doesn&apos;t work, so I&apos;m using the depilatory cream.
		I applied it wrong though in my haste, and it ended up not working as well as it should have today.
		Still, even misapplied and only used once, it&apos;s already showing much more visible results than dozens of applications of the home remedy.
	</p>
</section>
<section id="Minetest">
	<h2>Minetest</h2>
	<p>
		I&apos;ve gotten the textures for the first four trophy chests done.
		They&apos;re ... less inspired than I&apos;d like them to be, but they&apos;ll work just the same.
		The next step is to get the code done for them.
		I&apos;m considering releasing a working demo that only has chests for the original four elements, then adding more elements later.
	</p>
</section>
END
);
